﻿
using VXCompany.SilverlightLogging.MVVM.Models;
using System;
using System.Windows.Input;
namespace VXCompany.SilverlightLogging.MVVM.ViewModels
{
	/// <summary>
	/// Base class for all viewmodels.
	/// </summary>
	public class ViewModelBase : NotifyingBase
	{
	}

	/// <summary>
	/// Basic implementation of DelegateCommand.
	/// </summary>
	public class DelegateCommand : ICommand
	{

		protected Action Action { get; private set; }

		public DelegateCommand(Action action)
		{
			this.Action = action;
		}

		public bool CanExecute(object parameter)
		{
			return true;
		}

		public event EventHandler CanExecuteChanged;

		public void Execute(object parameter)
		{
			Action();
		}
	}

}
